package com.amumu.drama.common.constant;

import com.google.common.collect.Maps;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;

/**
 * @author sunzhuang
 * @date 2024/5/14 13:56
 * @slogan 天下风云出我辈, 一入代码岁月催
 * @desc 支付供应商类型
 */
@Getter
public enum PayProviderEnum {
    /**
     * 支付状态
     */
    WX_PAY("WX_PAY", "微信支付"),
    ALI_PAY("ALI_PAY", "支付宝"),
    SUMA_PAY("SUMA_PAY", "丰付支付"),
    FUIOU_PAY("FUIOU_PAY", "富友支付"),
    WE_PLAYER("WE_PLAYER", "微玩家");

    private String type;

    private String desc;

    PayProviderEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    private static final Map<String, PayProviderEnum> UNINDEX = Maps.uniqueIndex(Arrays.asList(values()), PayProviderEnum::getType);

    public static PayProviderEnum getByCode(String code) {
        return UNINDEX.get(code);
    }

}
